<?php
/*
 * @Author: 哲学家乔布斯 <wuyangii@qq.com>
 * @Date: 2022-10-20 21:41:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-07 22:37:15
 * @Descripttion:分享
 */

namespace app\api\controller\user\v1_0;



class Share extends Common
{
    protected $noNeedRight = ['config','user'];
    /**
     * @Author: 哲学家乔布斯 <wuyangii@qq.com>
     * @brief: 
     * @return 
     * @Descripttion: 分享配置
     */    
    public function config(){
        return self::successResult("成功",[
            'share_title' => aconfig("share_title",$this->agent_id),
            'share_img' => aconfig("share_img",$this->agent_id)
        ]);
    }
    /**
     * @Author: 哲学家乔布斯 <wuyangii@qq.com>
     * @brief: 
     * @return 
     * @Descripttion: 分享绑定
     */ 
    public function user(){
        $user_id = request()->param('user_id');
        (new \app\common\model\User())->where(['id' => $this->UserInfo['id'],'share_user_id' => 0])->update([
            'share_user_id' => $user_id,
        ]);
        return self::successResult("成功");
    }
    
    

}
